Skip to content

Add webhook alerts on monitor status transitions#4

Merged
crleonard merged 6 commits into
mainfrom
feature/added-webhook
May 4, 2026
Merged

Add webhook alerts on monitor status transitions#4
crleonard merged 6 commits into
mainfrom
feature/added-webhook

Conversation

@crleonard
Copy link
Copy Markdown
Owner

Summary

Adds webhook. Each monitor can now have a webhook URL
configured from its detail page; when a check transitions between up and
down, pingtower POSTs a JSON payload to that URL.

Behaviour

  • Fires only on status transitions (up → down or down → up). No noise on every successful poll.
  • Never fires on the very first poll — guarded by check.LastStatus != "" so adding a new monitor doesn't trigger a false alert.
  • Fire-and-forget delivery with a 10-second context timeout. Failures are logged but never block the polling loop.

Payload

{
  "check_id": "...",
  "name": "...",
  "url": "https://example.com",
  "status": "down",
  "previous_status": "up",
  "status_code": 503,
  "response_ms": 412,
  "checked_at": "2026-05-04T10:24:11Z"
}

@crleonard crleonard added the enhancement New feature or request label May 4, 2026
@crleonard crleonard merged commit c1d67c4 into main May 4, 2026
1 check passed
@crleonard crleonard deleted the feature/added-webhook branch May 4, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant